CheckId Subroutine

private subroutine CheckId(tables, pos)

Arguments

Type IntentOptional Attributes Name
type(TableCollection), intent(in) :: tables
integer(kind=long), intent(in) :: pos

Variables

Type Visibility Attributes Name Initial
integer(kind=long), public :: i

Source Code

SUBROUTINE CheckId    &
  ( tables, pos )

IMPLICIT NONE

! Function arguments
! Scalar arguments with intent(in):
INTEGER (KIND = long), INTENT(IN)  :: pos
! Array derived type with intent(in):
TYPE (TableCollection), INTENT(IN) :: tables

! Local scalars:
INTEGER (KIND = long) :: i
!------------end of declaration------------------------------------------------

!scan all Ids
DO i = 1, pos - 1

  IF ( tables % elem(i) % id == tables % elem(pos) % id ) THEN
    CALL Catch ('error', 'TableLib', 'Duplicate table id: ',  &
                 argument = tables % elem(pos) % id )
  END IF

END DO

END SUBROUTINE CheckId